<?php
// +----------------------------------------------------------------------
// | sfadmin - Suifeng Administration
// +----------------------------------------------------------------------
// | Copyright (c) 2017-2020 http://suifeng.tech All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: suifeng <1787585212@qq.com>
// +----------------------------------------------------------------------

namespace app\admin\common;

use suifeng\helper\HtmlHelper;

class ToolbarHelper
{
    public function renderButton($text, $icon, $class, $options = array())
    {
        $icon_html = $icon ? HtmlHelper::render_tag('i', array('class' => $icon)) : null;

        $attributes = $options;
        $attributes['type'] = 'button';
        $attributes['class'] = $class;
        return HtmlHelper::render_tag('button', $attributes, $icon_html . '&nbsp;&nbsp;' . $text . '&nbsp;');
    }
}